package de.hach.manno.webservice;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

/**
 * <event id='1' matchId='1' type='goal' playsForId='1' playtime='30'
 * previousEventId='' timestamp='2012-06-14 20:02:10'>
 * <description></description> </event>
 * 
 * @author hanspeter
 * 
 */
@Root
public class Event {

	@Attribute
	private int id;

	@Attribute
	private int matchId;

	@Attribute
	private String type;

	@Attribute
	private int playsForId;

	@Attribute
	private int playtime;

	@Attribute(required = false)
	private int previousEventId;

	@Attribute
	private String timestamp;

	@Element(required = false)
	private String description;

	public int getId() {
		return id;
	}

	public int getMatchId() {
		return matchId;
	}

	public String getType() {
		return type;
	}

	public int getPlaysForId() {
		return playsForId;
	}

	public int getPlaytime() {
		return playtime;
	}

	public int getPreviousEventId() {
		return previousEventId;
	}

	public String getTimestamp() {
		return timestamp;
	}

	public String getDescription() {
		return description;
	}

	@Override
	public String toString() {
		return "Event [" + this.id + " (" + this.timestamp + ")] " + this.type
				+ " " + this.playtime;
	}
}
